package com.purang.web.schedule.quartz.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.transaction.annotation.Transactional;

/**
 * quartz定时任务（模板模式），执行者添加事务
 *
 * @author Zheming Liu
 * @version 1.0-RELEASE
 * @since 1.0-RELEASE
 */
public abstract class QuartzJob implements Job {


    @Override
    @Transactional
    public void execute(JobExecutionContext jobExecutionContext) {
        doJob(jobExecutionContext);
    }

    /**
     * 执行任务
     */
    abstract void doJob(JobExecutionContext jobExecutionContext);
}
